
{{# 
var rows = d.rows;
}}



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{{= rows.title}} - {{lay.base.name}}</title>
<meta name="description" content="{{= d.description }}">

{{ include ../common/link }}
</head>
<body>

{{ include ../common/header }}

{{# if(rows){
  var myself = rows.uid === user.id;
}}
<div class="main layui-clear">
  <div class="wrap">
    <div class="content detail">
      <div class="fly-panel detail-box">
        <h1>{{=rows.title}}</h1>
        <div class="fly-tip fly-detail-hint" data-id="{{rows.id}}">
          
          {{ rows.stick > 0 ? '<span class="fly-tip-stick">置顶帖</span>' :'' }}
          {{ rows.status == 1 ? '<span class="fly-tip-jing">精帖</span>' : ''}}
          {{# if(rows.accept === -1){ }}
          <span>未结贴</span>
          {{# } else if(rows.accept >= 0 ){ }}
          <span class="fly-tip-jie">已采纳</span>
          {{# } }}
          
          {{# if(user.auth == 1){ }}
          <span class="layui-btn layui-btn-mini jie-admin" type="del" style="margin-left: 20px;">删除</span>
          {{# } }}
          
          {{# if(user.auth == 1 || user.auth == 2){ }}
            {{# if(rows.stick > 0){ }}
              <span class="layui-btn layui-btn-mini jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span>
            {{# } else { }}
              <span class="layui-btn layui-btn-mini jie-admin" type="set" field="stick" rank="1">置顶</span> 
            {{# };
            if(rows.status == 1){ }}
              <span class="layui-btn layui-btn-mini jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span>
            {{# } else { }}
              <span class="layui-btn layui-btn-mini jie-admin" type="set" field="status" rank="1">加精</span> 
            {{# }; 
          } }}
          
          <div class="fly-list-hint"> 
            <i class="iconfont" title="回答">&#xe60c;</i> {{rows.comment}}
            <i class="iconfont" title="人气">&#xe60b;</i> {{rows.hits}}
          </div>
        </div>
        <div class="detail-about">
          <a class="jie-user" href="/u/{{168*rows.uid}}/">
            <img src="{{rows.user.avatar}}" alt="{{rows.user.username}}">
            <cite>
              {{rows.user.username}}
              {{# if(rows.user.rmb){ }}
              <em style="padding:0 5px; color: #FF7200;">{{ lay.util.vip(rows.user.rmb) > 99 ? 'SVIP' : ('VIP' + lay.util.vip(rows.user.rmb))}}</em>
              {{# } }}
              <em>发布于{{lay.time(rows.time, true)}}</em>
              {{# }}
            </cite>
          </a>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="{{rows.id}}">

            <span style="color:#FF7200">悬赏：{{rows.experience}}飞吻</span>
            
            {{# if((user.username && myself && rows.accept == -1) || user.auth == 1){ }}
            <span class="layui-btn layui-btn-mini jie-admin" type="edit"><a href="/jie/edit/{{rows.id}}">编辑此贴</a></span>
            {{# } }}
              
          </div>
        </div>
        
        <div class="detail-body photos" style="margin-bottom: 20px;">
          {{ d.content(rows.content) }} 
        </div>
      </div>

      {{# var jieda = rows.jieda; }}
      
      <div class="fly-panel detail-box" style="padding-top: 0;">
        <a name="comment"></a>

        <ul class="jieda photos" id="jieda">
        {{# jieda.forEach(function(item, index){ 
          var myda = item.user.username === user.username;
        }}
          <li data-id="{{item.id}}" {{item.id == rows.accept ? 'class="jieda-daan"' : '' }}>
            <a name="item-{{item.time}}"></a>
            <div class="detail-about detail-about-reply">
              <a class="jie-user" href="/u/{{168*item.user.id}}/">
                <img src="{{item.user.avatar}}" alt="{{item.user.username}}">
                <cite>
                  <i>{{item.user.username}}</i>
                  {{# if(item.user.rmb) { }}
                  <em style="padding:0 ; color: #FF7200;">{{ lay.util.vip(item.user.rmb) > 99 ? 'SVIP' : ('VIP' + lay.util.vip(item.user.rmb))}}</em>
                  {{# } }}
                  {{# if(item.user.username === rows.username){ }}
                  <em>(楼主)</em>
                  {{# } else if(item.user.auth == 1) { }}
                  <em style="color:#5FB878">(管理员)</em>
                  {{# } else if(item.user.auth == 2) { }}
                  <em style="color:#FF9E3F">（社区之光）</em>
                  {{# } else if(item.user.auth == -1) { }}
                  <em style="color:#999">（该号已被封）</em>
                  {{# } }}
                </cite>
              </a>
              <div class="detail-hits">
                <span>{{lay.time(item.time)}}</span>
              </div>
              {{# if(item.id == rows.accept){ }}
              <i class="iconfont icon-caina" title="最佳答案"></i>
              {{# } }}
            </div>
            <div class="detail-body jieda-body">
              {{ d.content(item.content) }}
            </div>
            <div class="jieda-reply">
            <span class="jieda-zan {{d.session['zan'+item.id] ? 'zanok' : ''}}" type="zan">
              <i class="iconfont icon-zan"></i>
              <em>{{item.praise}}</em>
            </span>
            <span type="reply">
              <i class="iconfont icon-svgmoban53"></i>
              回复
            </span>
            {{# if(user.auth == 1 || user.auth == 2 || (user.username && myself && !myda)){ }}
              <div class="jieda-admin">
              {{# if(user.auth == 1 || (user.auth == 2 && item.accept != 1)){ }}
                <span type="edit">
                  编辑
                </span>
                <span type="del">
                  删除
                </span>
                {{# if(rows.accept == -1){ }}  
                <span class="jieda-accept" type="accept">
                  采纳
                </span>
                {{# } }}
              {{# } else if(rows.accept == -1 && !myda){ }}
                <span class="jieda-accept" type="accept">
                  采纳
                </span>
              {{# } }}
              </div>
            {{# } }}
            </div>
          </li>
        {{# }); if(jieda.length === 0){ }}
          <li class="fly-none">没有任何回答</li>
        {{# } }}
        </ul>
        
        {{ d.laypage }}
        
        <div class="layui-form layui-form-pane">
          <form action="/jie/reply/" method="post">
            <div class="layui-form-item layui-form-text">
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="我要{{myself ? '自问自答' : '回答'}}"  class="layui-textarea fly-editor" style="height: 150px;">{{d.edit ? d.edit.content : ''}}</textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="jid" value="{{rows.id}}">
              <input type="hidden" name="daPages" value="{{rows.jieda.pages}}">
              <button class="layui-btn" lay-filter="*" lay-submit>提交回答</button>
            </div>
          </form>
        </div>
      </div>

    </div>
  </div>
  <div class="edge">

    <dl class="fly-panel fly-list-one">
      <dt class="fly-panel-title">最近热帖</dt>
      {{# d.hot.forEach(function(item){ }}
      <dd>
        <a href="/jie/{{item.id}}.html">{{= item.title }}</a>
        <span><i class="iconfont">&#xe60b;</i> {{item.hits}}</span>
      </dd>
      {{# }); }}
    </dl>

    {{ include ../ad/edge }}
    
    <dl class="fly-panel fly-list-one">
      <dt class="fly-panel-title">近期热议</dt>
      {{# d.hotda.forEach(function(item){ }}
      <dd>
        <a href="/jie/{{item.id}}.html">{{= item.title }}</a>
        <span><i class="iconfont">&#xe60c;</i> {{item.comment}}</span>
      </dd>
      {{# }); }}
    </dl>

    <div style="">
      <script type="text/javascript">
          /*336*280*/
          var cpro_id = "u2482656";
      </script>
      <script type="text/javascript" src="http://cpro.baidustatic.com/cpro/ui/c.js"></script>
    </div>
    
  </div>
</div>
{{# } else { }}
<h2 class="page-title">404</h2>
<div class="fly-none">该问题并不存在，可能已被删除</div>
{{# } }}

{{ include ../common/footer }}

</body>
</html>